﻿<%@ Page Language="C#" MasterPageFile="~/INFTUR.master" AutoEventWireup="true" CodeFile="ManterCliente.aspx.cs" Inherits="INFTUR.ManterCliente" Title="Manter Cliente" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div id="principal" style="width:672px">
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <div id="consulta" style="width:674px">
            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                AutoGenerateColumns="False" DataSourceID="odsCliente" Width="566px" 
                HorizontalAlign="Justify">
                <Columns>
                    <asp:BoundField DataField="Cpf" HeaderText="Cpf" SortExpression="Cpf" />
                    <asp:BoundField DataField="Nome" HeaderText="Nome" SortExpression="Nome" />
                    <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
                    <asp:TemplateField HeaderText="Atualizar">
                        <ItemTemplate>
                            <asp:LinkButton ID="lbAtualizar" runat="server" onclick="lbAtualizar_Click">Atualizar</asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Remover">
                        <ItemTemplate>
                            <asp:LinkButton ID="lbRemover" runat="server" onclick="lbRemover_Click">Remover</asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <asp:ObjectDataSource ID="odsCliente" runat="server" 
                DataObjectTypeName="Negocios.ClienteBO" DeleteMethod="Remove" 
                InsertMethod="Insere" OldValuesParameterFormatString="original_{0}" 
                SelectMethod="ConsultaTodos" TypeName="Negocios.ClienteBOMetodos" 
                UpdateMethod="Atualiza">
                <DeleteParameters>
                    <asp:Parameter Name="cpf" Type="String" />
                </DeleteParameters>
            </asp:ObjectDataSource>
        </div>
        
        <div id="cadastro" class="divDados" style="width:400px">
        <table style="margin-bottom: 0px">
            <tr>
            <td>
                <asp:Label ID="cpf" runat="server" Text="CPF:"></asp:Label>
                </td>
            <td>
                <asp:TextBox ID="TBcpf" runat="server" MaxLength="11"></asp:TextBox>
&nbsp;
                <asp:Button ID="novocliente" runat="server" onclick="novocliente_Click" 
                    Text="Novo Cliente" />
                </td>
            </tr>
            <tr>
            <td>
                <asp:Label ID="nome" runat="server" Text="Nome:"></asp:Label>
                </td>
            <td>
                <asp:TextBox ID="TBnome" runat="server" MaxLength="50"></asp:TextBox>
                </td>
            </tr>
            <tr>
            <td>
                <asp:Label ID="endereco" runat="server" Text="Endereço:"></asp:Label>
                </td>
            <td>
                <asp:TextBox ID="TBendereco" runat="server" MaxLength="100"></asp:TextBox>
                </td>
            </tr>
            <tr>
            <td>
                <asp:Label ID="telefone" runat="server" Text="Telefone:"></asp:Label>
                </td>
            <td>
                <asp:TextBox ID="TBtelefone" runat="server" MaxLength="12"></asp:TextBox>
                </td>
            </tr>
            <tr>
            <td>
                <asp:Label ID="email" runat="server" Text="Email:"></asp:Label>
                </td>
            <td>
                <asp:TextBox ID="TBemail" runat="server" style="margin-left: 1px"></asp:TextBox>
                </td>
            </tr>
            <tr>
            <td colspan="2">
                <asp:Button ID="gravar" runat="server" Enabled="False" onclick="gravar_Click" 
                    Text="Gravar/Atualizar" />
&nbsp;&nbsp;&nbsp;
                <asp:Button ID="cancelar" runat="server" Enabled="False" 
                    onclick="cancelar_Click" Text="Cancelar" />
                </td>
            </tr>
        </table>
            <br />
            <br />
            <asp:Label ID="Lerro" runat="server"></asp:Label>
        </div>
    </div>
</asp:Content>